function [gp] = my_IDFT(G)
    % 获取频谱的大小
    [M, N] = size(G);
    
    % 创建输出图像
    gp = zeros(M, N);
    
    % 遍历频域中的每一个点，计算逆傅里叶变换
    for x = 1:M
        for y = 1:N
            sum = 0;
            for u = 1:M
                for v = 1:N
                    sum = sum + G(u, v) * exp(2*pi*1i * ((u-1)*(x-1)/M + (v-1)*(y-1)/N));
                end
            end
            gp(x, y) = sum / (M * N);  % 归一化
        end
    end
end